Text notes can "include" another note as a read-only widget or an interactive
widget, depending on the type of note.
This can be useful for e.g. including a dynamically generated chart (from
scripts & "render HTML" note) or other more advanced use cases.
Including a note
In the Formatting toolbar,
look for the button.
There is also a keyboard shortcut defined for it but it is not allocated
by default.
To include a note that is already linked, right-click a reference link
to it in a text note being edited and select Convert link to an included note,
at the end of the menu. The include gets the box size that suits the note,
as one added from the button does.
An attachment can be included the
same way, from the context menu of a link to it (see Embedding an attachment there).
A link to blocks of a text note is converted the same way, with Convert link to note excerpt,
and the include then shows only those blocks. See Block references.
Box sizes
The box size sets how much of the included note is shown.
- Tiny shows a single row instead of the content: the note's icon,
its title with the path to the note above it, and buttons to act on the
note. The included note is never rendered, so wherever the note is shown
outside the editor, such as in print, in a tooltip or on a shared page,
a Tiny include appears as a link to the included note.
- Small and Medium show the content in a box of limited height.
Text scrolls inside the box, while a picture, a diagram or a video is scaled
down to fit it.
- Full shows the whole content.
- Expandable shows only the title until its arrow
is pressed.
A new include gets the size that suits what it shows:
- Tiny for a note or an attachment that has no preview, such as
a relation map or an archive.
- Small for audio.
- Full for a code note or a code file, such as a
.js, .py or .txt attachment,
and for an excerpt of the blocks of a text note.
- Medium for anything else.
The dialog that includes a note selects that size once the note is picked,
and you can choose another one there. To change the size later, select
the include and use the Box size menu in its toolbar, or the Size submenu
of its More actions menu.
Resizing
A Small, Medium or Expandable include can be resized
to any width and height. A Tiny or Full include always fits
its content.
- To resize an include, select it and drag the handle in its bottom-right
corner. To change only the width or only the height, drag the middle of
its right or bottom edge instead, where a touch screen shows a handle too.
In right-to-left text, the handle is in the bottom-left corner and the
width changes from the left edge.
- Resizing works with a mouse, a pen or a finger.
- While the height changes, moving the handle near the top or the bottom
of the note scrolls the note.
- An include narrower than the note is centered, so changing its width moves
both of its sides. Making it as wide as the note returns it to the full
width.
- To cancel a resize, press Esc before releasing the handle.
- To reset the size, double-click the corner handle, or double-tap it on
a touch screen. Double-clicking the right or bottom edge resets only the
width or the height.
- Choosing a box size resets the height. Choosing Tiny or Full resets
the width too.
- While an Expandable include is collapsed, only its width can be
changed.
Caption
An include can have a caption, shown centered at the bottom of its box.
The caption is part of the text note, so it can be formatted like the rest
of the text, for example in bold or with a link.
- To add a caption, select the include, press the Toggle caption on button
in its toolbar and type the caption.
- To remove the caption, press the same button again. Pressing it once more
brings back the text it had, as long as the note stays open.
- A Tiny include has no caption. Switching an include to Tiny removes
its caption, and switching it back to a larger size restores the caption,
as long as the note stays open.
- An Expandable include shows its caption under the title while the
content is collapsed, and under the content once it is expanded.
Title
The title row of an include links to the included note and holds its buttons.
To show only the content, select the include and press the Show title button
in its toolbar. Pressing it again shows the title.
- While the title is hidden, the More actions button
in the toolbar of the include opens the menu of the included note.
- A Tiny or Expandable include always shows its title, and
its toolbar has no Show title button.
Opening an included note
To open an included note in a new tab, press the Open in new tab button
at the end of its title. An embedded attachment has the same button.
The More actions button
at the end of the title row opens the same menu as right-clicking anywhere
on the title row: the other places to open the note in and, for an embedded
attachment, the actions on the attachment.
In a note being edited, the menu also has the commands of the include's
toolbar: the Size submenu, Show title and Show caption,
each checked while it is in effect, and Convert to link at the end.
A drawing canvas, an included text or code note and an embedded code file
also have Editable, above Size. For an embedded attachment
they follow its first group of actions; for an included note they end the
menu.
To show an include of size Medium or Full on the whole screen,
press the Fullscreen button
at the end of its title. An excerpt of the blocks of a note has an Edit excerpt button there instead;
see Block references.
To return, press Exit fullscreen in
the top-right corner, or Esc.
A Tiny include has these buttons instead, followed by the same More actions button:
- For a note, Quick edit opens
the note in Quick edit,
and Open in new tab opens
it in a new tab.
- For an embedded attachment, Open externally opens
the file in another application, and Download downloads
it. The size of the file is shown under its title.
Converting an include to a link
To replace an include with a link to the included note, select it and
press the Convert to link button
in its toolbar, or choose Convert to link at the end of its More actions menu.
An embedded attachment turns into a link to the attachment the same way.
Included notes in the share functionality
If a shared note contains one or
more included notes, they will be displayed in the content of the note
as if they were part of the note itself. The caption of an include is shown
under the included content. A Tiny include is shown as a link to
the included note instead, and so is an include that would show a note
already shown around it, such as a note that includes itself. The same
goes for a printed or exported note.
For this to work, the included notes must also be shared, otherwise they
will not be shown. However, the included notes can still be hidden from
the note tree via #shareHiddenFromTree.
Interactive notes
Since v0.104.0, included notes might become interactive depending on their
note type:
Included images
An included image, whether an image note or an image attachment, is shown
in the image viewer, which zooms and pans it:
- To zoom, press the Zoom in and Zoom out buttons in the
bottom-right corner of the image, or pinch on a touch screen. The percentage
between them resets the zoom.
- To zoom with the mouse wheel, click the image first. Until then, the mouse
wheel scrolls the note.
- To pan an image that is zoomed in, drag it. At its fitted size, dragging
the image on a touch screen scrolls the note.
- To return to the fitted size, double-click the image.
In a Small or Medium box, the image is scaled down to fit
the height of the box. In fullscreen, it fits the screen.
Editing an include in place
An included text note, an included code note and an embedded code file
such as a .js, .py or .txt attachment
can be edited without leaving the note that includes them. A code note
or file is shown with syntax highlighting until then.
- To edit, select the include and turn on the Editable button
at the start of its toolbar, or check Editable in its More actions menu.
Turn Editable off to return to the preview.
- While an included text note has the focus, the formatting toolbar applies
to it. The notes it includes in turn stay read-only.
- Code is edited in the same code editor as a Code note,
with its theme, indentation and line wrapping settings.
- The changes are saved as you type, to the included note or to the attachment,
as they would be in its own tab.
- An include of Block references edits
only the referenced blocks.
- Editing is not available in a read-only note,
for an included note marked
#readOnly, or for an attachment
of another note.
Drawing canvases
A drawing canvas is an Excalidraw canvas, like the one of a Canvas note, drawn directly in the text
note. It is not a note of its own: the drawing is kept in a Canvas.excalidraw attachment of the text note and is saved
together with the text.
- To insert a drawing canvas, open the Insert menu
of the Formatting toolbar and
choose Drawing canvas, above Mermaid diagram.
It is also available as Drawing canvas in the Slash Commands. The canvas is added
empty and editable, in a Medium box with its title hidden, and takes
the focus, ready for drawing.
- To draw on a canvas that does not have the focus, click it first. Until
then, the mouse wheel and touch gestures scroll the note. The canvas then
has the tools, menus and keyboard shortcuts of a Canvas note. The toolbars,
the menus and the properties of the selected shapes show only while the
canvas has the focus, so elsewhere the drawing reads like a picture in
the text.
- A new drawing has the background color of the note. A background chosen
from the Excalidraw menu replaces it.
- To protect a finished drawing from accidental changes, select it and turn
off the Editable button
at the start of its toolbar, or uncheck Editable in its More actions menu.
The drawing can then be panned and zoomed but not changed, and its toolbar
holds only the zoom buttons. To draw again, turn Editable back on.
- The box sizes, resizing, the caption and the title work as for an included
note, but the toolbar of a drawing leaves the box size, Show title and Convert to link to
its More actions menu.
- In the desktop layout, Excalidraw keeps its desktop interface however
small the box is. In the mobile layout, a narrow or short box switches
it to a compact interface. For more room, choose Full, or show
the title and press Fullscreen.
- Pictures added to the drawing are stored in the same attachment.
- In a read-only note, the drawing
can be viewed but not changed.
Limitations
- The Excalidraw shape library is not saved for a drawing canvas.
- Outside the editor, for example in a tooltip, when printing or in the
list of attachments, the drawing is shown as a picture. On a shared page,
it appears as a link to download
Canvas.excalidraw.
- A copy of a drawing canvas pasted in the same note shares the drawing
with the original, so a change to one shows in the other only after the
note is opened again. A copy pasted in another note gets a drawing of its
own.